package com.wc.AlgoOJ_train.train1.c7.A706;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/11 10:53
 * @description 光头强的RPG难题
 * http://43.138.190.70:8888/p/A706
 */
public class Main {
    public static void main(String[] args) {
        long[] dp = new long[51];
        dp[1] = 3;
        dp[2] = 6;
        dp[3] = 6;
        for (int i = 4; i <= 50; i++) {
            // 前面一个满足，那么我们只有一种
            // 再前面的满足，然后涂色第一个，再就有俩了
            dp[i] = dp[i - 1] + dp[i - 2] * 2;
        }
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int n = sc.nextInt();
            System.out.println(dp[n]);
        }
    }
}
